<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../org/angular.min.js"></script>
</head>
<body>
    <div ng-app="vm" ng-controller="ctrl">
        <span>搜索</span><input type="text" ng-model="search">
        <table border="1" width="600">
            <tr>
                <td>编号</td>
                <td>点击数</td>
                <td>标题</td>
            </tr>
            <tr ng-repeat="(index,value) in lists">
                <td>{{value.id}}</td>
                <td>{{value.click}}</td>
                <td>{{value.title}}</td>
            </tr>
        </table>
    </div>
    <script>
        var vm = angular.module('vm',[]);
        vm.controller('ctrl',['$scope','$filter',function($scope,$filter){
            $scope.data = [
                {id: 1, click: 100, title: "后盾人"},
                {id: 2, click: 200, title: "PHP"},
                {id: 3, click: 300, title: "后盾网"}
            ]
            $scope.lists = $scope.data;
            $scope.$watch('search',function(n,o){
                $scope.lists = $filter('filter')($scope.data,n)
            })
        }])
    </script>
</body>
</html>